import request from '@/utils/request'

// 获取员工列表
export const getEmployeesList = (params) => {
  return request({
    url: '/sys/user',
    method: 'GET',
    params
  })
}

// 删除用户信息
export const delEmployees = (id) => {
  return request({
    url: '/sys/user/' + id,
    method: 'DELETE'
  })
}

// 新增员工
export const addUser = (data) => {
  return request({
    url: '/sys/user',
    method: 'POST',
    data
  })
}

// 上传excel
export const importEmployees = (data) => {
  return request({
    url: '/sys/user/batch',
    method: 'POST',
    data
  })
}

// 保存用户登陆账户信息
export const saveUserInfo = (id, data) => {
  return request({
    url: `/sys/user/${id}`,
    method: 'PUT',
    data
  })
}

//  给员工分配角色
export const assiginRoles = (data) => {
  return request({
    url: '/sys/user/assignRoles',
    method: 'PUT',
    data
  })
}
